<?php


use Illuminate\Support\Facades\Route;

Route::namespace('admin')->group(function (){
    //需要登录并且进行鉴权
    Route::prefix('admin')->middleware('checkAdminLoginAndCheAuth')->group(function (){
        Route::any('/','HomeController@index')->name('admin.main');
        Route::any('/home','HomeController@home')->name('admin.home');

        Route::any('/bills','CommonController@bills')->name('admin.bills.bills');





        Route::any('/businesses','BusinessController@businesses')->name('admin.businesses.businesses');
        Route::any('/add_businesses','BusinessController@add')->name('admin.businesses.add');
        Route::any('/edit_businesses','BusinessController@edit')->name('admin.businesses.edit');
        Route::any('/delete_businesses','BusinessController@delete')->name('admin.businesses.delete');


        Route::any('sciences','SciencesController@sciences')->name('admin.sciences.sciences');
        Route::any('/add_sciences','SciencesController@add')->name('admin.sciences.add');
        Route::any('/edit_sciences','SciencesController@edit')->name('admin.sciences.edit');
        Route::any('/delete_sciences','SciencesController@delete')->name('admin.sciences.delete');


        Route::any('users','UsersController@users')->name('admin.users.users');
        Route::any('recharge','UsersController@recharge')->name('admin.users.recharge');
        Route::any('set_shop','UsersController@setShopLevel')->name('admin.users.set_shop');

        Route::any('goods','GoodsController@goods')->name('admin.goods.goods');
        Route::any('/add_goods','GoodsController@add')->name('admin.goods.add');
        Route::any('/del_goods','GoodsController@del')->name('admin.goods.del');
        Route::any('/edit_goods','GoodsController@edit')->name('admin.goods.edit');



        Route::any('categorys','CategorysController@categorys')->name('admin.categorys.categorys');
        Route::any('/add_categorys','CategorysController@add')->name('admin.categorys.add');
        Route::any('/del_categorys','CategorysController@delete')->name('admin.categorys.del');
        Route::any('/edit_categorys','CategorysController@edit')->name('admin.categorys.edit');


        Route::any('cursors','CursorController@cursors')->name('admin.cursors.cursors');
        Route::any('/add_cursors','CursorController@add')->name('admin.cursors.add');
        Route::any('/edit_cursors','CursorController@edit')->name('admin.cursors.edit');
        Route::any('/del_cursors','CursorController@delete')->name('admin.cursors.del');


        Route::any('orders','OrdersController@orders')->name('admin.orders.orders');
        Route::any('send_orders','OrdersController@send_orders')->name('admin.orders.send_orders');

        Route::any('areas','AreaController@lists')->name('admin.areas.areas');
        Route::any('/add_areas','AreaController@add')->name('admin.areas.add');
        Route::any('/del_areas','AreaController@del')->name('admin.areas.del');


        Route::any('/shops','AdminController@shops')->name('admin.shops.shops');
        Route::any('/sbills','SbillsController@sbills')->name('admins.sbills.sbills');
        Route::any('/withsa','SbillsController@withs')->name('admin.sbills.withs');


        Route::any('/prices','PricesOrdersController@prices')->name('admin.prices.prices');
        Route::any('/prices_add','PricesOrdersController@prices_add')->name('admin.prices.add');


        Route::any('/withs','WithController@withs')->name('admin.withs.withs');
        Route::any('/confirm','WithController@confirm')->name('admin.withs.confirm');

    });




    //不需要登录的后台接口
    Route::prefix('admin')->group(function (){
        Route::any('login','LoginController@login')->name('admin.login');//后台用户登录
        Route::any('file_up','HomeController@file_up')->name('admin.file_up');
        Route::any('file_up1','HomeController@local1')->name('admin.local1');
        Route::any('file_up2','HomeController@file_up2')->name('admin.local2');
        Route::any('areas_childs','AreaController@areas_childs')->name('admin.areas.childs');
        Route::any('logout','HomeController@logout');
    });
});
